
D_XILINX_BASEAPI_FLAGS= \
	-DOS_LINUX_SOC \
	-D__STDC_FORMAT_MACROS 
D_XILINX_LIBMSLOG_LIBS 	:=`pkg-config --libs	libmslog_xilinx`
D_XILINX_LIBMSLOG_INCLUDES 	:=`pkg-config --cflags	libmslog_xilinx`
D_XILINX_LIBMSCOMMON_LIBS 	:=`pkg-config --libs	libmscommon_xilinx`
D_XILINX_LIBMSCOMMON_INCLUDES 	:=`pkg-config --cflags	libmscommon_xilinx`
D_XILINX_LIBPROTOCOL_LIBS 	:=`pkg-config --libs	libmsprotocol_xilinx`
D_XILINX_LIBPROTOCOL_INCLUDES 	:=`pkg-config --cflags	libmsprotocol_xilinx`

C_XILINX_INCLUDE	:=${D_AXILINX_LIBMSLOG_INCLUDES} ${D_XILINX_LIBMSCOMMON_INCLUDES}  ${D_XILINX_BASEAPI_FLAGS} -Isrc 
C_XILINX_LIBS		:=${D_AXILINX_LIBMSLOG_LIBS}     ${D_XILINX_LIBMSCOMMON_LIBS} -pthread -lm  
libmsprotocol_xilinx_PATH=/home/sugao/lin
libmsprotocol_xilinx_CC=${libmsprotocol_xilinx_PATH}/bin/arm-xilinx-linux-gnueabi-gcc
libmsprotocol_xilinx_SRC=${C_SRC}
libmsprotocol_xilinx_CFLAGS=${C_XILINX_INCLUDE} ${C_XILINX_LIBS} ${CFLAGS_SHARE} -fPIC

xilinx:libmsprotocol_xilinx install_xilinx

libmsprotocol_xilinx: 
	mkdir -p $(OUT_LIB)
	mkdir -p $(OUT_INCLUDE)
	cp -fr src/*.h $(OUT_INCLUDE)
	$($@_CC)  $($@_SRC)  $($@_CFLAGS)  -o $(OUT_LIB)/$(PROGRAM_NAME).so 

install_xilinx: 
	mkdir -p  ${prefix_xilinx}/lib/ 
	mkdir -p  ${prefix_xilinx}/include/   
	mkdir -p  ${prefix_xilinx}/lib/pkgconfig/ 
	cp    -fr $(OUT_LIB)/$(PROGRAM_NAME).so	${prefix_xilinx}/lib/     
	cp    -fr $(OUT_INCLUDE)			${prefix_xilinx}/include/	     
	cp    -fr platform/$(PROGRAM_NAME)_xilinx.pc	${prefix_xilinx}/lib/pkgconfig/

uninstall_xilinx:
	rm -fr ${prefix_xilinx}/lib/$(PROGRAM_NAME).so 
	rm -fr ${prefix_xilinx}/include/$(PROGRAM_NAME)
	rm -fr ${prefix_xilinx}/lib/pkgconfig/$(PROGRAM_NAME)_xilinx.pc
	rm -fr ${prefix_xilinx}/bin/mscore_mctu
